home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / TCL1 / __MANDEL / MANDELBR / CMANDELW.C < prev    next >
Text File  |  1992-05-31  |  1KB  |  40 lines

  1. //    CMandelWindow.c
  2.  
  3. #include <CList.h>
  4. #include "CMandelWindow.h"
  5. #include "CPane.h"
  6.  
  7. /******************************************************************************
  8.  Update
  9.  
  10.         Update the contents of a window
  11.         
  12.         overridden because I didn't want the visRgn erased.  flicker is evil.
  13.  ******************************************************************************/
  14.  
  15. void    CMandelWindow::Update()
  16. {
  17.     GrafPtr        savePort;                /* The current port                    */
  18.     Rect        updateRect;                /* Bounding box of update region    */
  19.     
  20.     GetPort(&savePort);                    /* Save the original port            */
  21.     Prepare();                            /* Set up Window's port                */
  22.     BeginUpdate(macPort);                /* Start the update process            */
  23.                                         /* This restricts the visible area    */
  24.                                         /*   to just the update region,        */
  25.                                         /*   meaning that no drawing will    */
  26.                                         /*   occur outside this region        */
  27.  
  28.     
  29.     ClipRect(&thePort->portRect);        /* Clip to the entire window        */
  30.     
  31.     if (itsSubviews != NULL) {            /* Draw all subviews                */
  32.         updateRect = (**thePort->visRgn).rgnBBox;
  33.         itsSubviews->DoForEach1((EachFunc1) Pane_Draw, (long) &updateRect);
  34.     }
  35.     
  36.     EndUpdate(macPort);                    /* End the update process            */
  37.     SetPort(savePort);                    /* Restore the original port        */
  38.     ForceNextPrepare();
  39. }
  40.